package com.ssy.lingxi.product.repository.channelCommodity;

import com.ssy.lingxi.product.entity.channelCommodity.ChannelCommodityMember;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 渠道商品采购商持久化层
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/28
 */
public interface ChannelCommodityMemberRepository extends JpaRepository<ChannelCommodityMember,Long>, JpaSpecificationExecutor<ChannelCommodityMember> {

    List<ChannelCommodityMember> findAllByChannelCommodityMemberIdAndIdIn(Long memberId, List<Long> idList);

//    Boolean existsByMemberIdInAndStatusAndChannelCommodityCommodityIdAndShopListShopIdInAndIdIsNotAndMemberRoleId(List<Long> memberIdList, Integer status, Long commodityId, List<Long> shopIdList, Long channelCommodityMemberId, Long memberRoleId);

    Boolean existsByShopListShopIdInAndStatusAndChannelCommodityCommodityIdAndChannelCommodityMemberIdAndMemberIdInAndMemberRoleId(List<Long> shopIdList, Integer status, Long commodityId, Long channelCommodityMemberId, List<Long> memberIdList, Long memberRoleId);
}
